<template>
  <div class="indexHeader">
    <div class="wp">
      <div class="l">
        <a href="#" class="imgs">
          <img src="~assets/img/chuntubiao.png" alt="图片" class="img1">
          <img src="~assets/img/wenzilogo_bai.png" alt="图片" class="img2">
        </a>
        <ul class="nav">
          <li>
            剧照
          </li>
          <li>
            投稿
          </li>
        </ul>
      </div>
      <div class="r">
        <div class="so">
          <input type="text" class="so_input">
          <input type="button" class="btn">
        </div>
        <div class="history" v-on:mouseenter="showHistroy" v-on:mouseleave="showHistroy">
          <img src="~assets/img/history.png" alt="">
        </div>
        <div class="login" v-on:click="login">
          <img src="~assets/img/chuntubiao.png" alt="">
        </div>
      </div>
    </div>
    <HistoricalRecord class="HistoricalRecord" v-show="isShowHistory"></HistoricalRecord>
  </div>
</template>
<script>
import HistoricalRecord from "@/views/home/childComps/HistoricalRecord";
import {ref} from "vue";
// import {getBus} from "@/utils/Bus";

export default {
  name: "PublicHeader",
  setup(props,context){
    let isShowHistory=ref(false)
    // const publicBus=getBus()
    function showHistroy(){
      isShowHistory.value=!isShowHistory.value
    }
    function  login(){
      context.emit('showLogin')
      // publicBus.emit('showLogin',!isShowHistory.value)
    }
    return{
      isShowHistory,

      showHistroy,
      login
    }
  },
  components:{
    HistoricalRecord,
  }
}
</script>
<style scoped>
.indexHeader{
  background-color: #111111;
  height: 94px;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
}
.wp{
  width: 80%;
  /*max-width: 1500px;*/
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
.l{
  display: flex;
  padding-top: 22px;
}
.l .nav{
  display: flex;
  margin-left: 30px;
  padding-top: 10px;
}
.l .nav li{
  font-size: 25px;
  color: #f7f2ee;
  padding: 5px 20px;
  transition: .1s;
}
.l .nav li:hover{
  border-bottom: 4px solid #ee9439;
}
.r{
  display: flex;
  padding-top: 20px;
}
.r .so{
  display: flex;
}
.r .so_input{
  height: 52px;
  width: 236px;
  border-radius: 26px 0 0 26px;
  background: rgba(238,148,57,.4);
  padding-left: 20px;
  color: white;
  font-size: 18px;
  line-height: 52px;
}
.r .btn{
  width: 114px;
  height: 52px;
  border-radius: 26px;
  margin-left: -20px;

  background: #ee9439 url(~assets/img/so.png) no-repeat 36px 8px;
  background-size: 40px 40px;
}
.history{
  padding-top: 8px;
  margin: 0 40px;
}
.history img{
  width: 40px;
  height: 40px;
}
.login img{
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
.indexHeader img{
  vertical-align: bottom;
}
.indexHeader .img1{
  width: 54px;
  height: 54px;
  margin-right: 10px;
  border-radius: 7px;
}
.indexHeader .img2{
  height: 54px;
  width: 140px;
}
.HistoricalRecord{

}
</style>